//
// File:   _main.cc
// Author: ben
//
// Created on October 15, 2008, 12:46 PM
//

#include <stdlib.h>
#include <iostream>
//#include <octave-2.9.9/octave/oct.h>
#include <string.h>
#include <sstream>
#include <octave-3.0.3/octave/oct.h>
#include <fstream>

#include "recommend.h"


#include "headerm.h"

/*
#define N_USERS 6
#define N_MOVIES 5
 **/
using namespace std;

//
//
//




int main(int argc, char** argv) {
	
	if(strcmp("help",argv[1])==0){
		Showhelp();
		return(0);
	}
	
	int i, n_tot=N_USERS, ib,mode;
	
	//class recommend test(N_USERS, N_MOVIES);
	
	
	
	/*
	 * if(argc>1){
		cout << "method:" << argv[1] << ", option:" << atoi(argv[2]) << endl;
	}
	else{
		cout << "method:" << argv[1] << endl;
	}
	 **/
	
	
	
	
	mode	=	-1;
        cout << argv[1] << endl;
	
	//cout << argv[1] << "|" << endl;
	//cout << argc << endl;
	
	if(strcmp("maxf",argv[1])==0 && argc==2){
		mode	=	1;
	}
	if(strcmp("lp",argv[1])==0 && argc==2){
		mode	=	2;
	}
	if(strcmp("lp-userbased",argv[1])==0 && argc==3){
		mode	=	3;
	}
	if(strcmp("lp-moviebased",argv[1])==0  && argc==3){
		mode	=	4;
	}
	if(strcmp("wwt-userbased",argv[1])==0  && argc==3){
		mode	=	5;
	}
	if(strcmp("wwt-moviebased",argv[1])==0  && argc==3){
		mode	=	6;
	}
	if(strcmp("binary-userbased",argv[1])==0  && argc==3){
		mode	=	7;
	}
	if(strcmp("dwalk-movies",argv[1])==0  && argc==4){
		mode	=	9;
	}
	if(strcmp("dwalk-direct",argv[1])==0  && argc==4){
		mode	=	8;
	}
        if(strcmp("dwalk-users",argv[1])==0  && argc==4){
		mode	=	10;
	}
	
	if(mode<0){
		cout << "Recommend Tools: errors in arguments" << endl;
		cout << "Try help" << endl;
		return(-1);
	}
	if(argc>0){
		cout << argv[1] << endl;
		cout << "mode: " <<  mode << endl;
	}

        //POUR ANALYSER LES fichier PR DE FF
        //AnalysePRfiles(mode,argc,argv);

        //POUR ANALYSER LES DONNEES DU SITE
        //AnalyseWeb(mode,argc,argv,"test.dat","training.dat");
        //POUR ANALYSER PAR BUCKET
        AnalyseAll(mode,argc,argv);

	
	
	return (EXIT_SUCCESS);
}

